package patten.xingwei.strategy.demo1;

/**
 * Description：订单金额计算上下文
 * Author：zwenzhi
 * Date：2023/11/18 14:59
 */
public class OrderContext {
    private OrderStrategy orderStrategy;

    public OrderContext(OrderStrategy orderStrategy) {
        this.orderStrategy = orderStrategy;
    }

    public void createOrder(String orderType,double originalPrice){
        double promotionalPrice = orderStrategy.getPromotionalPrice(originalPrice);
        System.out.println("创建订单:"+orderType+",活动价格:"+promotionalPrice);
    }


}
